In LinkHolderArray::doVariants(), redlinks need to be checked as well.
Currently a simple Title::exists() or Title::getArticleId() call on a
non-existent title can cause the title marked as redlinks in LinkCache,
even if a title in another variant exists. A visible appearance is that
the function refuses to try other variants of a link if the link has
already been checked by {{#ifexist:}}, which internally calls
$lang->findVariantLink() then $title->exists() is invoked.
$titlesToBeConverted is also tweaked to avoid the trailing "\0".
Change-Id: I741e2938eb364ed29f10f058da260848a6774f9f